package org.lucene;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.AutomatonQuery;
import org.apache.lucene.util.automaton.Automaton;
import org.apache.lucene.util.automaton.BasicAutomata;
import org.apache.lucene.util.automaton.BasicOperations;
import org.apache.lucene.util.automaton.LevenshteinAutomata;

public class FSA {
	public static void main(String[] args) {
		Term term = new Term("body", "dogs~1");
		Automaton fuzzy = new LevenshteinAutomata("dogs", false).toAutomaton(1);
		Automaton fuzzyPrefix = BasicOperations.concatenate(fuzzy,
				BasicAutomata.makeAnyString());
		AutomatonQuery query = new AutomatonQuery(term, fuzzyPrefix);
		
		
	}
}
